<?php
require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
MYDCONN();
$GLOBALS['MYT']=$GLOBALS['MYD'];
	$label = '';
	$mode = 'ED';
	form_pr('edtCdcInvoice','','','post');
	if($_GET['jB'] == 8) {$label = 'Locutorios';} elseif($_GET['jB'] == 9) {$label = 'Petty Cash';}
	if (isset($_POST['TimeInvoice'])) {
		$Condition = "('{$_POST['TimeInvoice']}' >= DATE(a.TimeInvoice))";
	} else {
		$Condition = "a.Status = 1";
	}
	$GET = $GLOBALS['MYD']->db_array("SELECT DATE(a.TimeInvoice) AS TimeInvoice,
		 DATE(a.TimePay) AS TimePay,
		 DATE(a.TimeClose) AS TimeClose,
		 a.Description,
		 z.name AS Stat,
		 b.name AS office,
		 a.Status AS Sta,
		 b.ref AS off,
		 a.Ref
		 FROM ccenter_invoices AS a
		 INNER JOIN main_offices AS b ON b.ref = {$_SESSION[$SESSOF]}
		 INNER JOIN hcce_status AS z ON z.StatRef = a.Status AND z.Type = a.TYPE
		 WHERE a.TYPE = {$_GET['jB']} AND {$Condition}
		 ORDER BY TimeInvoice DESC LIMIT 0,1");

	mn_field('hidden','ED','RefInvoice',$GET[1]['Ref'],'','','','');
	mn_field('hidden','ED','Contract','','','','','');
	mn_field('hidden','ED','Type',$_GET['jB'],'','','',''); ?>
<div class="title"><?php echo $label;?> | <?php
	mn_field('button','ED','invPrint','Imprimir','','','','" onclick="
		newprint(\'Aplications/Export_Print.mex?ID=02&MOD=CCENTER0&jB='.$_GET['jB'].'&OB='.$GET[1]['Ref'].'\',\'_blank\');'); ?></div>
<table width="98%"  border="0" cellpadding="3" cellspacing="1">
  <tr bgcolor="#F2F2F2">
    <td colspan="3">
	<table  border="0" cellpadding="1" cellspacing="3">
        <tr>
          <td>Periodo</td>
          <td><?php mn_field('date','ED','TimeInvoice',$GET[1]['TimeInvoice'],'edtCdcInvoice','8','','');
					mn_field('button','ED','frmSubmit','Ver','','','','" onclick="
					document.edtCdcInvoice.action=\'Modules/CentrodeCustos/mback.php?jB='.$_GET['jB'].'\';
					subform(\'edtCdcInvoice\',\'app\');'); ?></td>
        </tr>
        <tr>
          <td>Descrição:</td>
          <td><?php mn_field('text','ED','Description',$GET[1]['Description'],'255','60','','');
			mn_field('button','ED','invSubmit','Alterar','','','','" onclick="
					document.edtCdcInvoice.action=\'_response/rsproxy.php?jB='.$_GET['jB'].'&CH=1&pr=cdc_invother\';
					subform(\'edtCdcInvoice\',\'app\');'); ?></td>
          </tr>
        <tr>
          <td>Estado: </td>
          <td><?php echo $GET[1]['Stat'];?></td>
        </tr>
        <tr>
          <td height="27">Data de Fecho:</td>
          <td><?php mn_field('date','ED','TimeClose',$GET[1]['TimeClose'],'edtCdcInvoice','8','','');
		  if ($GET[1]['Sta'] == 1) {
					mn_field('button','ED','frmSubmit','Fechar','','','','" onclick="
					document.edtCdcInvoice.action=\'_response/rsproxy.php?jB='.$_GET['jB'].'&CL=1&pr=cdc_invother\';
					subform(\'edtCdcInvoice\',\'app\');');
			}	?></td>
          </tr>
    </table>	</td>
    </tr>
</table>
Desdobramentos <div id="invOtItems">
      <?php include($GLOBALS['PAD'].'Modules/CentrodeCustos/Lib/list_invotherarticles.php'); ?></div>
</form>